package work1.work3.student;

    public class Collegestudent extends Student {
        Collegestudent(String name,float a,float b,float c){
            super(name);
            this.type="专科生";
            courses[0]=a;
            courses[1]=b;
            courses[2]=c;
        }
        @Override
        public String calculateGrade() {
            float sum=(courses[0]+courses[1]+courses[2])/3;
            if (sum>=80){
                return "优秀";
            }
            else if (sum>=70&sum<80) {
                return "良好";
            }
            else if (sum>=60&sum<70){
                return "中等";
            }
            else if (sum>=50&sum<60){
                return "及格";
            }
            else {
                return "不及格";
            }
        }
    }

